Over time, Web pages have evolved to include complex operations that can alter and/or modify a document being rendered in a host environment. In order to achieve some of these complex operations, Web programmers can utilize scripting languages to work within the host environment and with the document being rendered. Many host environments distinguish between a layout engine, which facilitates the rendering of a document, and a scripting engine, which executes script included in an associated Web page. Scripts running in the scripting engine can be designed to access not only the document being rendered in the layout engine, but objects and/or elements within the document. In some cases, when a layout engine supports standardized document access, such as a Document Object Model (DOM), a Web programmer can write a script to manipulate a document and its elements based upon this model.
A layout engine and a scripting engine provide different functionality from one another and, as such, they typically reside, on some level, in separate modules. This can range from a simple logical separation to a more complex separation between software and/or hardware components. More often, these engines reside in separate and/or associated software modules that communicate with one another. One benefit of this separation is that it enables a layout engine to more easily support multiple scripting engines. However, since the layout engine is separated, on some level, from a scripting engine, communication mechanisms between the modules oftentimes limit what can be exposed between the modules, can adversely affect runtime performance, and can introduce unintended memory management issues.